import request from '@/config/axios'

// 员工奖惩记录 VO
export interface PenaltiesVO {
  id: number // 序号
  userId: number // 员工ID
  userName: string // 员工姓名
  penaltiesType: number // 奖惩类型
  penaltiesCategory: number // 奖惩项目
  actionDate: Date // 执行日期
  monetaryValue: number // 涉及金额（元）
  physicalItem: string // 奖励/罚没物品
  penaltiesStatus: number // 记录状态
  remark: string // 备注说明
}

// 员工奖惩记录 API
export const PenaltiesApi = {
  // 查询员工奖惩记录分页
  getPenaltiesPage: async (params: any) => {
    return await request.get({ url: `/oa/penalties/page`, params })
  },

  // 查询员工奖惩记录详情
  getPenalties: async (id: number) => {
    return await request.get({ url: `/oa/penalties/get?id=` + id })
  },

  // 新增员工奖惩记录
  createPenalties: async (data: PenaltiesVO) => {
    return await request.post({ url: `/oa/penalties/create`, data })
  },

  // 修改员工奖惩记录
  updatePenalties: async (data: PenaltiesVO) => {
    return await request.put({ url: `/oa/penalties/update`, data })
  },

  // 删除员工奖惩记录
  deletePenalties: async (id: number) => {
    return await request.delete({ url: `/oa/penalties/delete?id=` + id })
  },

  // 导出员工奖惩记录 Excel
  exportPenalties: async (params) => {
    return await request.download({ url: `/oa/penalties/export-excel`, params })
  },
}